<%@ page contentType="text/html; charset=UTF-8" session="false"%>
<%@ include file="/WEB-INF/jspf/import.jspf"%>

<div class="pageHeader">
	<form onsubmit="return navTabSearch(this);" id="pagerForm" name="searchForm" method="post">
		<input type="hidden" name="pageNum" value="${pager.pageNo}" />
        <input type="hidden" name="pageSize" value="${pager.pageSize}" />
		<input type="hidden" name="orderField" value="create_at" />
    	<input type="hidden" name="orderDirection" value="desc" />
		<div class="searchBar">
			<table class="searchContent">
				<tbody>
					<tr>
						<td><label>优惠标题：</label><input type="text" name="name" value="${param.name}" class="textInput"></td>
						<td><label>所在地区：</label><input type="text" name="area" value="${param.area}" class="textInput" alt="输入多个用;隔开"></td>
						<td><label>信息状态：</label>
						    <select  name="timeStatus">
						    	<c:forEach var="e" items="${statusDesc}">
						    		<option value="${e.key}" <c:if test="${e.key==param.timeStatus}">selected</c:if> >${e.value}</option>
						    	</c:forEach>
						    </select>
                    </td>
                    <td><label>车友会：</label><input type="text" name="clubName" value="${param.clubName}" class="textInput" alt="输入多个用;隔开"></td>
					</tr>
					<tr>
						<td><label>品牌：</label><input type="text" name="brandName" value="${param.brandName}" class="textInput" alt="输入多个用;隔开"></td>
						<td><label>车系：</label><input type="text" name="seriesName" value="${param.seriesName}" class="textInput" alt="输入多个用;隔开"></td>
						<td><label>结束时间：</label><input type="text" name="endDate" value="${param.endDate}" class="date" readonly="readonly"></td>
						<td><label>主题：</label>
						    <select  name="themeId">
						    		<option value="0">全部</option>
						    	<c:forEach var="theme" items="${themes}">
						    		<option value="${theme.themeId}" <c:if test="${theme.themeId==param.themeId}">selected</c:if> >${theme.themeName}</option>
						    	</c:forEach>
						    </select>
                    	</td>
					</tr>
				</tbody>
			</table>
			<div class="subBar">
                <ul>
                    <li><div class="buttonActive"><div class="buttonContent"><button type="submit">查询</button></div></div></li>
                </ul>
            </div>
		</div>
	</form>
</div>
<div class="pageContent">
	<div class="panelBar">
		<ul class="toolBar">
			<li><a class="icon"  href="${ROOT}/admin/promotion/showCreate.do" target="navTab" rel="promotionPush_detail" title="创建信息"><span>创建信息</span></a></li>
		</ul>
	</div>
	<table class="table" style="width: 100%" layoutH="160">
		<thead>
			<tr>
				<th>优惠标题</th>
				<th>推广范围</th>
				<th width="12%" orderField="update_time" class="${orderField=='update_time' ? orderDirection : ''}">权重</th>
				<th width="6%" orderField="received" class="${orderField=='received' ? orderDirection : ''}">开始时间</th>
				<th>结束时间</th>
				<th width="20%">信息状态</th>
				<th width="6%">操作</th>

			</tr>
		</thead>
		<tbody>
			<c:forEach var="e" items="${pager.resultList}">
				<tr>
					<td>${e.name}</td>
					<td>${e.pushRange}</td>
					<td>${e.sortWeight}</td>
					<td><fmt:formatDate value="${e.promotionPublish.startDate}" pattern="yyyy-MM-dd"/></td>
					<td><fmt:formatDate value="${e.promotionPublish.endDate}" pattern="yyyy-MM-dd"/></td>
					<td>
						<c:choose>
							<c:when test="${e.timeStatus==-1 }">已删除</c:when>
							<c:when test="${e.timeStatus==1 }">未开始</c:when>
							<c:when test="${e.timeStatus==2 }">进行中</c:when>
							<c:when test="${e.timeStatus==3 }">已结束</c:when>
						</c:choose>
					</td>
					<td>
						<a class="btnEdit" href="${ROOT}/admin/promotion/detail.do?id=${e.promotionId}"
	                         target="navTab" rel="promotionPush_detail" title="查看详情">修改</a>
	                    <a class="btnDel" href="${ROOT}/admin/promotion/delete.do?id=${e.promotionId}" 
	                         title="确定要删除吗？此操作不能后退！" target="ajaxTodo">删除</a>
	                </td>
				</tr>
			</c:forEach>
		</tbody>
	</table>
</div>
<div class="panelBar">
    <div class="pages">
        <span>共 ${pager.total} 条</span>
    </div>
    <div class="pagination" targetType="navTab" totalCount="${pager.total}" numPerPage="${pager.pageSize}" pageNumShown="10" currentPage="${pager.pageNo}"></div>
</div>
